package com.vitogiovanni.tobook;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.ProgressBar;
 
public class SplashScreenActivity extends Activity {
 
    // Splash screen timer
    private static int SPLASH_TIME_OUT = 3000;
    private ProgressBar progressBar;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        
        progressBar = (ProgressBar) findViewById(R.id.loading_splash_activity);
        progressBar.setVisibility(View.VISIBLE);
 
        new Handler().postDelayed(new Runnable() {
 
            @Override
            public void run() {
                
                Intent i = new Intent(SplashScreenActivity.this, MainActivity.class);
                startActivity(i);
                finish();
                progressBar.setVisibility(View.GONE);
            }

        }, SPLASH_TIME_OUT);
    }
}